/*
 * @Author: your name
 * @Date: 2020-08-25 00:45:18
 * @LastEditTime: 2020-08-25 21:17:22
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \新建文件夹\two-app\src\api\addUser.js
 */
import { getUrl, postUrl, putUrl } from '../utils/https'

// 添加用户
export const addUser = (data) => {
  return postUrl('/user', data)
}

// 获取用户数据
export const getUser = () => {
  return getUrl('/user/user')
}

// 更新用户
export const putUser = (data) => {
  return putUrl('/user/user', data)
}

// 获取身份数据
export const getIdentity = () => {
  return getUrl('/user/identity')
}

// 获取身份id
export const getAuthority = () => {
  return getUrl('/user/identity_view_authority_relation')
}

// 添加身份
export const addEdit = (data) => {
  return getUrl('/user/identity/edit', data)
}

// 添加api接口权限
export const addAuthorityApi = (data) => {
  return getUrl('/user/authorityApi/edit', data)
}

// 获取视图权限数据
export const getViewAuthority = () => {
  return getUrl('/user/view_authority')
}

// 添加视图权限
export const addViewAuthorityView = (data) => {
  return getUrl('/user/authorityView/edit', data)
}

// 获取api接口权限
export const addApiAuthority = () => {
  return getUrl('/user/api_authority')
}

// 给身份设定api接口权限
export const setIdentityApi = (data) => {
  return postUrl('/user/setIdentityApi', data)
}

// 给身份设定视图权限
export const setIdentityView = (data) => {
  return postUrl('/user/setIdentityView', data)
}
